package com.sinba.common.business.dto;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.sinba.common.dto.BaseDTO;

//匹配成功
@SuppressWarnings({ "serial" })
public class MatchGridDTO extends BaseDTO{
	private Long id;
	private String buyUser;//买出ID
	private String sellUser;//
	private Long matchMoney;//匹配金额
	private Long status;//状态
	private Date createTime;
	private String imgUrl;	//凭证图片地址
	private String message;	//留言
	private Date messageTime;	//留言时间

	private String sellUserName;
	private String sellUserStatus;
	private String sellUserBankType;
	private String sellUserBankAccount;
	private String sellUserBankPhone;
	private String sellUserBankQq;
	
	private String buyUserName;
	private String buyUserStatus;
	private String buyUserBankType;
	private String buyUserBankAccount;
	private String buyUserBankPhone;
	private String buyUserBankQq;
	
	private Long buyMoney;//买入总金额
	private Long sellMoney;//卖出总金额
	private Long surplusTime;//剩余汇款时间
	private Long surplusConfirmTime;//剩余确认时间
	private Date closeTime;//关闭时间
	private String confirmType;//确认方式(48小时自动确认)
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	
	public String getBuyUser() {
		return buyUser;
	}
	public void setBuyUser(String buyUser) {
		this.buyUser = buyUser;
	}
	public String getSellUser() {
		return sellUser;
	}
	public void setSellUser(String sellUser) {
		this.sellUser = sellUser;
	}
	
	public Long getMatchMoney() {
		return matchMoney;
	}
	public void setMatchMoney(Long matchMoney) {
		this.matchMoney = matchMoney;
	}
	public Long getStatus() {
		return status;
	}
	public void setStatus(Long status) {
		this.status = status;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public String getImgUrl() {
		return imgUrl;
	}
	public void setImgUrl(String imgUrl) {
		this.imgUrl = imgUrl;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public Date getMessageTime() {
		return messageTime;
	}
	public void setMessageTime(Date messageTime) {
		this.messageTime = messageTime;
	}
	public String getSellUserName() {
		return sellUserName;
	}
	public void setSellUserName(String sellUserName) {
		this.sellUserName = sellUserName;
	}
	public String getSellUserBankType() {
		return sellUserBankType;
	}
	public void setSellUserBankType(String sellUserBankType) {
		this.sellUserBankType = sellUserBankType;
	}
	public String getSellUserBankAccount() {
		return sellUserBankAccount;
	}
	public void setSellUserBankAccount(String sellUserBankAccount) {
		this.sellUserBankAccount = sellUserBankAccount;
	}
	public String getSellUserBankPhone() {
		return sellUserBankPhone;
	}
	public void setSellUserBankPhone(String sellUserBankPhone) {
		this.sellUserBankPhone = sellUserBankPhone;
	}
	public String getSellUserStatus() {
		return sellUserStatus;
	}
	public void setSellUserStatus(String sellUserStatus) {
		this.sellUserStatus = sellUserStatus;
	}
	public String getSellUserBankQq() {
		return sellUserBankQq;
	}
	public void setSellUserBankQq(String sellUserBankQq) {
		this.sellUserBankQq = sellUserBankQq;
	}
	public String getBuyUserName() {
		return buyUserName;
	}
	public void setBuyUserName(String buyUserName) {
		this.buyUserName = buyUserName;
	}
	public String getBuyUserStatus() {
		return buyUserStatus;
	}
	public void setBuyUserStatus(String buyUserStatus) {
		this.buyUserStatus = buyUserStatus;
	}
	public String getBuyUserBankType() {
		return buyUserBankType;
	}
	public void setBuyUserBankType(String buyUserBankType) {
		this.buyUserBankType = buyUserBankType;
	}
	public String getBuyUserBankAccount() {
		return buyUserBankAccount;
	}
	public void setBuyUserBankAccount(String buyUserBankAccount) {
		this.buyUserBankAccount = buyUserBankAccount;
	}
	public String getBuyUserBankPhone() {
		return buyUserBankPhone;
	}
	public void setBuyUserBankPhone(String buyUserBankPhone) {
		this.buyUserBankPhone = buyUserBankPhone;
	}
	public String getBuyUserBankQq() {
		return buyUserBankQq;
	}
	public void setBuyUserBankQq(String buyUserBankQq) {
		this.buyUserBankQq = buyUserBankQq;
	}
	public Long getBuyMoney() {
		return buyMoney;
	}
	public void setBuyMoney(Long buyMoney) {
		this.buyMoney = buyMoney;
	}
	public Long getSellMoney() {
		return sellMoney;
	}
	public void setSellMoney(Long sellMoney) {
		this.sellMoney = sellMoney;
	}
	public Long getSurplusTime() {
		
		surplusTime = getDatePoor(new Date(),this.getCreateTime());
		
		return surplusTime;
	}
	public void setSurplusTime(Long surplusTime) {
		this.surplusTime = surplusTime;
	}
	
	public Long getSurplusConfirmTime() {
		
		surplusConfirmTime = getDatePoor(new Date(),this.getMessageTime());
		return surplusConfirmTime;
	}
	public void setSurplusConfirmTime(Long surplusConfirmTime) {
		this.surplusConfirmTime = surplusConfirmTime;
	}
	public static long getDatePoor(Date endDate, Date nowDate) {
		if(endDate!=null && nowDate!=null){
			long nd = 1000 * 24 * 60 * 60;
		    long nh = 1000 * 60 * 60;
		    long nm = 1000 * 60;
		    // long ns = 1000;
		    // 获得两个时间的毫秒时间差异
		    long diff = endDate.getTime() - nowDate.getTime();
		    // 计算差多少天
		    long day = diff / nd;
		    // 计算差多少小时
		    long hour = diff % nd / nh;
		    // 计算差多少分钟
		    long min = diff % nd % nh / nm;
		    // 计算差多少秒//输出结果
		    // long sec = diff % nd % nh % nm / ns;
		    return hour;
		}else{
			return 0;
		}
	    
	    
	}
	public Date getCloseTime() {
		return closeTime;
	}
	public void setCloseTime(Date closeTime) {
		this.closeTime = closeTime;
	}
	public String getConfirmType() {
		return confirmType;
	}
	public void setConfirmType(String confirmType) {
		this.confirmType = confirmType;
	}
	
}
